<template>
  <div class="custom">
    <header-top></header-top>
    <div class="custom-nav">
      <img src="../../common/img/logo.png" />
      <b><img src="../../common/img/help.png" /></b>
    </div>
    <div class="custom-search">
      <div class="search-title">
        <span>公告:</span>
        <ul>
          <li v-for="item in title" :key="item">
            <a href="">{{ item }}</a>
          </li>
        </ul>
        <a href="" id="more">更多公告>></a>
      </div>
      <div class="search-input">
        <input type="text" placeholder='请输入完整的问题,如"如何查找订单" ' />
        <button>提问</button>
      </div>
    </div>
    <div class="custom-self">
      <span class="self-title"><b>常用自助服务</b></span>
      <ul>
        <li :key="item.path" v-for="item in self_help">
          <img :src="item.path" />
          <div class="text">
            <span id="title">
              {{ item.title }}
            </span>
            <span id="details">
              {{ item.details }}
            </span>
          </div>
        </li>
      </ul>
    </div>
    <div class="custom-hot">
      <span class="title"><b>热点问题</b></span>
      <ul class="hot-ul-1">
        <li
          v-for="(item, index) in hot_title"
          :key="index"
          @click="getActive(index)"
          :class="{ hot_title: true, active: active }"
          :ref="'title' + index"
        >
          {{ item }}
        </li>
      </ul>
      <ul class="hot-ul-2">
        <li
          v-for="(item, index) in hot_link"
          :key="index"
          v-show="currentIndex == index"
        >
          <ul>
            <li :key="link" v-for="link in item" class="hot-ul-3">
              <a href="">
                {{ link }}
              </a>
            </li>
          </ul>
        </li>
      </ul>
    </div>
    <div class="custom-contact">
      <div class="title">
        <b>联系我们</b>
      </div>
      <div class="contact-robot">
        <div class="robot-img">
          <img src="../../common/img/custom.jpg" alt="" />
          <div><button>立即咨询</button></div>
        </div>
        <div class="robot-button">
          <dl v-for="(item, index) in robot" :key="index" class="button-dl">
            <dt class="button-dt">
              {{ item.title }}
            </dt>
            <dd class="button-dd">
              <span class="button-span">
                {{ item.text }}
              </span>
              <button class="button-btn">
                {{ item.btn }}
              </button>
            </dd>
          </dl>
        </div>
      </div>
    </div>
    <div class="foot">
      <ul>
        <li v-for="item in foot" :key="item.path">
          <img :src="item.path" />
        </li>
      </ul>
    </div>
  </div>
</template>
<script>
import headerTop from "../../components/HeaderTop/HeaderTop.vue";
export default {
  components: {
    headerTop,
  },
  data() {
    return {
      title: [
        "关于沉默账户管理规则修订公告",
        "关于《京豆使用规则》修订公告",
        "自营小时购商品售后运费规则新增公告",
      ],
      self_help: [
        {
          path: require("../../common/img/self-1.jpg"),
          title: "查询订单",
          details: "快速查看订单详情、配送进度、确认收货等",
        },
        {
          path: require("../../common/img/self-2.jpg"),
          title: "我要催单",
          details: "催发货、催配送、1小时快速答复",
        },
        {
          path: require("../../common/img/self-3.jpg"),
          title: "配送服务查询",
          details: "查看您所在地址支持的配送服务类型和时效",
        },
        {
          path: require("../../common/img/self-4.jpg"),
          title: "我的发票",
          details: "申请发票补开、查询发票类型、开具详情",
        },
        {
          path: require("../../common/img/self-5.jpg"),
          title: "申请售后",
          details: "快速提交退换货/维修申请查看处理进度、退款记录",
        },
        {
          path: require("../../common/img/self-6.jpg"),
          title: "申请价格保护",
          details: "申请价格保护（差价返还）、查询价保记录",
        },
        {
          path: require("../../common/img/self-7.jpg"),
          title: "取消订单",
          details: "申请取消订单、终止发货",
        },
        {
          path: require("../../common/img/self-8.jpg"),
          title: "账户安全",
          details: "修改密码、绑定/换绑手机、提高账户安全等",
        },
      ],
      hot_title: [
        "金融问题",
        "售后服务",
        "配送查询",
        "订单查询",
        "财务问题",
        "账户信息",
      ],
      hot_link: [
        [
          "什么是京东钱包？",
          "想要咨询白条支付等金融问题怎么办？",
          "如何进行实名认证？",
          "什么是退换货运费险？",
        ],
        ["我提交的售后返修单何时能为我审核？", "取消订单/退货后怎么退款给我？"],
        [
          "如何查询物流信息？",
          "商品一直没收到，怎么办？",
          "不方便收货，怎么办？",
          "运费收取标准",
          "我的包裹现在到哪里了？",
          "自提点在哪里？",
        ],
        [
          "我的退款会给我退到哪里？",
          "如何区分京东自营销售和第三方卖家销售的商品？",
        ],
        [
          "京东E卡如何使用？",
          "在结算页为什么无法使用优惠券？",
          "余额提现怎么操作？",
          "余额提现以后，为什么一直没到账？",
          "支付方式有哪些？如何支付？",
          "可以开发票吗？",
        ],
        [
          "如何查询我的个人信息？",
          "已绑定的手机号不能正常使用，如何修改手机号？",
          "微信的京东购物账号和其他端口的京东账号能合并吗？",
          "如何验证手机？如何绑定手机？",
        ],
      ],
      robot: [
        {
          title: "电话客服",
          text: "预约客服，主动回电",
          btn: "点此预约",
        },
        {
          title: "在线客服",
          text: "在线解答您的咨询，高效、便捷",
          btn: "点此咨询",
        },
        {
          title: "提建议",
          text: "对帮助中心提建议",
          btn: "我要留言",
        },
      ],
      foot: [
        {
          path: require("../../common/img/custom_1.png"),
        },
        {
          path: require("../../common/img/custom_2.png"),
        },
        {
          path: require("../../common/img/custom_3.png"),
        },
        {
          path: require("../../common/img/custom_4.png"),
        },
      ],
      currentIndex: "",
      active: false,
    };
  },
  methods: {
    getActive(index) {
      this.currentIndex = index;
      for (let i = 0; i < 6; i++)
        this.$refs[`title${i}`][0].setAttribute("class", "hot_title");
      this.$refs[`title${index}`][0].setAttribute("class", "hot_title active");
    },
  },
};
</script>
<style scoped>
li {
  display: inline;
}
.custom-nav {
  position: relative;
  width: 100%;
  height: 60px;
  background-color: rgb(249, 249, 249);
}
.custom-nav img {
  position: relative;
  margin-left: 280px;
}
.custom-nav b img {
  position: relative;
  margin-left: -100px;
  margin-top: 8px;
}
.custom-search {
  background-color: rgb(133, 183, 22);
  position: relative;
  height: 150px;
}
.custom-search .search-title span {
  color: rgb(255, 255, 255);
  font-size: 14px;
  font-weight: bold;
  position: relative;
  float: left;
  margin-left: 280px;
  margin-top: 20px;
}
.custom-search .search-title ul {
  position: relative;
  float: left;
  margin-top: 20px;
}
.custom-search .search-title li {
  padding-right: 20px;
}
.custom-search .search-title li ::before {
  position: absolute;
  margin-left: -10px;
  margin-top: 10px;
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 5px;
  background-color: rgb(255, 255, 255);
}
.custom-search .search-title li a {
  text-decoration: none;
  color: rgb(249, 249, 249);
}
.custom-search .search-title li a:hover {
  color: rgb(255, 228, 0);
}
.custom-search .search-title #more {
  font-size: 12px;
  position: relative;
  float: right;
  margin-top: 25px;
  margin-right: 280px;
  text-decoration: none;
  color: rgb(249, 249, 249);
}
.custom-search .search-title #more:hover {
  color: rgb(255, 228, 0);
}
.custom-search .search-input {
  position: relative;
  float: left;
  margin-left: 275px;
  width: 64%;
  height: 55px;
  background-color: rgb(255, 228, 0);
}
.custom-search .search-input input {
  position: relative;
  height: 40px;
  margin-top: 7.5px;
  margin-left: 5px;
  width: 88%;
  border: none;
}
.custom-search .search-input button {
  position: relative;
  float: right;
  border: none;
  background-color: rgb(255, 228, 0);
  font-size: 27px;
  margin-top: 5px;
  margin-right: 25px;
  outline: none;
}
.custom-self {
  position: relative;
}
.custom-self .self-title {
  position: relative;
  font-size: 18px;
  top: 15px;
  margin-left: 280px;
}
.custom-self ul {
  display: flex;
  flex-wrap: wrap;
  width: 65%;
  margin-top: 30px;
  margin-left: 250px;
  height: 200px;
}
.custom-self li {
  display: inline-flex;
  height: 60px;
  width: 25%;
  padding-right: 10px;
}
.custom-self li .text {
  display: inline-flex;
  flex-direction: column;
  justify-content: space-around;
  padding-left: 5px;
}
.custom-self li .text #title {
  color: rgb(102, 102, 102);
  font-size: 18px;
}
.custom-self li .text #details {
  font-size: 10px;
  color: rgb(180, 183, 174);
}
.custom-hot {
  background-color: rgb(249, 249, 249);
}
.custom-hot .title {
  position: relative;
  font-size: 18px;
  top: 20px;
  margin-left: 280px;
}
.custom-hot .hot-ul-1 {
  position: relative;
  margin-top: 50px;
  margin-left: 200px;
}
.custom-hot .hot_title {
  display: inline-flex;
  height: 50px;
  width: 160px;
  font-weight: bold;
  background-color: rgb(233, 233, 233);
  align-items: center;
  justify-content: center;
  margin-right: 20px;
}
.custom-hot .hot_title.active {
  color: rgb(255, 255, 255);
  background-color: rgb(243, 183, 1);
}
.custom-hot .hot_title.active::before {
  content: "";
  position: absolute;
  margin-top: 50px;
  border-right: 8px solid;
  border-bottom: 8px solid;
  border-top: none;
  border-left: none;
  border-color: rgb(243, 183, 1);
  transform: rotateZ(45deg);
  z-index: 100;
}
.custom-hot .hot-ul-2 {
  position: relative;
  background-color: rgb(255, 255, 255);
  margin-top: -15px;
  margin-left: 240px;
  width: 70%;
}
.custom-hot .hot-ul-2 ul {
  position: relative;
  margin-top: 15px;
  padding-bottom: 20px;
}
.custom-hot .hot-ul-3 {
  display: inline-block;
  position: relative;
  margin-top: 10px;
  width: 50%;
}
.custom-hot .hot-ul-3 ::before {
  content: "";
  position: absolute;
  margin-left: -10px;
  margin-top: 15px;
  border-right: 5px solid;
  border-bottom: 5px solid;
  border-color: rgb(105, 187, 120);
}
.custom-hot .hot-ul-3 a {
  text-decoration: none;
  color: rgb(88, 88, 88);
  height: 32px;
  line-height: 32px;
}
.custom-hot .hot-ul-3 a:hover {
  color: rgb(202, 139, 0);
}
.custom-contact {
  position: relative;
  margin-top: -15px;
  background-color: rgb(241, 241, 241);
}
.custom-contact .title {
  position: relative;
  top: 18px;
  margin-left: 280px;
  font-size: 18px;
}
.custom-contact .contact-robot {
  position: relative;
  margin-left: 240px;
  margin-top: 20px;
  background-color: rgb(249, 249, 249);
  width: 70%;
  box-shadow: 0px 0px 0px 2px rgb(234, 234, 234);
  height: 300px;
}
.contact-robot .robot-img {
  position: relative;
  padding-top: 30px;
  height: 150px;
}
.contact-robot .robot-img div {
  position: relative;
  float: right;
  padding-top: 45px;
  padding-right: 200px;
}
.contact-robot .robot-img button {
  background-color: rgb(243, 183, 1);
  border: none;
  color: rgb(255, 255, 255);
  height: 33px;
  width: 100px;
  text-align: center;
  outline: none;
}
.contact-robot .robot-button {
  position: relative;
  background-color: rgb(241, 241, 241);
  height: 150px;
}
.robot-button .button-dl {
  position: relative;
  float: left;
  height: 150px;
  width: 28%;
  margin-left: 30px;
}
.robot-button .button-dt {
  position: relative;
  margin-top: 25px;
  font-size: 16px;
  color: rgb(102, 102, 102);
}
.robot-button .button-dd {
  position: relative;
  margin-top: 25px;
  display: flex;
  flex-flow: column;
  align-items: flex-start;
  height: 70px;
  justify-content: space-around;
  color: rgb(153, 153, 153);
  font-size: 10px;
}
.robot-button .button-btn {
  background-color: rgb(106, 187, 119);
  width: 100px;
  height: 40px;
  border: none;
  font-size: 14px;
  color: white;
  outline: none;
}
.foot {
  background-color: rgb(245, 245, 245);
  position: relative;
  height: 100px;
}
.foot ul {
  position: relative;
  margin-left: 100px;
}
.foot li {
  display: inline-block;
  position: relative;
  margin-left: 80px;
}
</style>